
from math import sqrt

def int_sqrt(n):
    r = int(sqrt(n))
    if r * r == n:
        return r
    else:
        return 0

"""
a + b = 1000 - c
a^2 + b^2 = c^2
(a - b)^2 = c^2 * 2 - (1000 - c) ^ 2 = c ^ 2 + 2000 * c - 1000000
"""

for c in range(int(1000 * (sqrt(2) - 1)) + 1, 1000):
    r = int_sqrt(c * c + 2000 * c - 1000000)
    if r > 0:
        a = (1000 - c - r) / 2
        b = (1000 - c + r) / 2
        print a, b, c, a * a + b * b, c * c, a + b + c, a * b * c